;
(function () {
    function _toConsumableArray(r) {
        return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
    }

    function _nonIterableSpread() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }

    function _unsupportedIterableToArray(r, a) {
        if (r) {
            if ("string" == typeof r) return _arrayLikeToArray(r, a);
            var t = {}.toString.call(r).slice(8, -1);
            return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
        }
    }

    function _iterableToArray(r) {
        if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
    }

    function _arrayWithoutHoles(r) {
        if (Array.isArray(r)) return _arrayLikeToArray(r);
    }

    function _arrayLikeToArray(r, a) {
        (null == a || a > r.length) && (a = r.length);
        for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
        return n;
    }

    System.register(['./index-legacy-BBSVeb5I.js'], function (exports, module) {
        'use strict';

        var defineComponent, mergeModels, useModel, computed, createElementBlock, normalizeClass, Fragment, renderList,
            mergeProps, createBaseVNode, renderSlot, createTextVNode, toDisplayString, openBlock;
        return {
            setters: [function (module) {
                defineComponent = module.d;
                mergeModels = module.J;
                useModel = module.m;
                computed = module.f;
                createElementBlock = module.a;
                normalizeClass = module.n;
                Fragment = module.F;
                renderList = module.j;
                mergeProps = module.aa;
                createBaseVNode = module.b;
                renderSlot = module.I;
                createTextVNode = module.v;
                toDisplayString = module.t;
                openBlock = module.o;
            }],
            execute: function execute() {
                var _hoisted_1 = ["title"];
                var _hoisted_2 = ["type", "checked", "title", "onChange"];
                var _sfc_main = exports("_", /* @__PURE__ */defineComponent({
                    __name: "SelectGroup",
                    props: /* @__PURE__ */mergeModels({
                        options: {},
                        titles: {},
                        props: {},
                        multiple: {
                            type: Boolean,
                            default: false
                        },
                        compact: {
                            type: Boolean
                        }
                    }, {
                        "modelValue": {},
                        "modelModifiers": {}
                    }),
                    emits: /* @__PURE__ */mergeModels(["toggle"], ["update:modelValue"]),
                    setup: function setup(__props, _ref) {
                        var __emit = _ref.emit;
                        var props = __props;
                        var emit = __emit;
                        var modelValue = useModel(__props, "modelValue");
                        var internalValue = computed({
                            get: function get() {
                                return props.multiple ? Array.isArray(modelValue.value) ? modelValue.value : [] : modelValue.value;
                            },
                            set: function set(newValue) {
                                modelValue.value = newValue;
                            }
                        });

                        function toggleOption(option) {
                            if (props.multiple) {
                                var newValue = _toConsumableArray(internalValue.value);
                                var index = newValue.indexOf(option);
                                if (index > -1) {
                                    newValue.splice(index, 1);
                                } else {
                                    newValue.push(option);
                                }
                                internalValue.value = newValue;
                            } else {
                                internalValue.value = option;
                            }
                            emit("toggle");
                        }

                        function isSelected(option) {
                            return props.multiple ? internalValue.value.includes(option) : internalValue.value === option;
                        }

                        return function (_ctx, _cache) {
                            return openBlock(), createElementBlock("fieldset", {
                                class: normalizeClass(["flex-inline flex-wrap overflow-hidden", _ctx.compact ? "gap-1px" : "gap-3"])
                            }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, function (option, idx) {
                                var _props$props, _props$props2, _ctx$titles, _ctx$titles2, _ctx$titles4;
                                return openBlock(), createElementBlock("label", mergeProps({
                                    key: option,
                                    class: ["relative px-2.5 py-1", [isSelected(option) ? "text-primary bg-primary/10 hover:bg-primary/10" : "text-gray-500 bg-hover hover:bg-selected", _ctx.compact && idx === 0 ? "!rounded-l-md" : "", _ctx.compact && idx === _ctx.options.length - 1 ? "!rounded-r-md" : "", !_ctx.compact && "rounded-md", (props === null || props === void 0 || (_props$props = props.props) === null || _props$props === void 0 || (_props$props = _props$props[idx]) === null || _props$props === void 0 ? void 0 : _props$props.class) || ""]],
                                    ref_for: true
                                }, props === null || props === void 0 || (_props$props2 = props.props) === null || _props$props2 === void 0 ? void 0 : _props$props2[idx], {
                                    title: (_ctx$titles = _ctx.titles) === null || _ctx$titles === void 0 ? void 0 : _ctx$titles[idx]
                                }), [createBaseVNode("div", null, [renderSlot(_ctx.$slots, "default", {
                                    value: option,
                                    title: (_ctx$titles2 = _ctx.titles) === null || _ctx$titles2 === void 0 ? void 0 : _ctx$titles2[idx],
                                    index: idx
                                }, function () {
                                    var _ctx$titles$idx, _ctx$titles3;
                                    return [createTextVNode(toDisplayString((_ctx$titles$idx = (_ctx$titles3 = _ctx.titles) === null || _ctx$titles3 === void 0 ? void 0 : _ctx$titles3[idx]) !== null && _ctx$titles$idx !== void 0 ? _ctx$titles$idx : option), 1)];
                                })]), createBaseVNode("input", {
                                    type: _ctx.multiple ? "checkbox" : "radio",
                                    checked: isSelected(option),
                                    title: (_ctx$titles4 = _ctx.titles) === null || _ctx$titles4 === void 0 ? void 0 : _ctx$titles4[idx],
                                    class: "absolute inset-0 cursor-pointer op-0.1",
                                    onChange: function onChange($event) {
                                        return toggleOption(option);
                                    }
                                }, null, 40, _hoisted_2)], 16, _hoisted_1);
                            }), 128))], 2);
                        };
                    }
                }));
            }
        };
    });
})();
